package com.lyz.redisDelayQueue.controller;


import com.lyz.redisDelayQueue.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


/**
 * @author tengfei_sun
 * @version [1.0, 2021-04-02]
 * @Description: TODO 文件上传
 */

@RestController
@RequestMapping("/common")
public class UploadController {
    @Autowired
    private UploadService uploadService;

    @PostMapping("/upload")
    public String upload(@RequestParam("file") MultipartFile file) {
        return uploadService.url(file);
    }
}
